package com.mapper;

import com.pojo.User2;
import org.mybatis.spring.SqlSessionTemplate;

import java.util.List;

public class UserMapperImpl implements UserMapper {

    // 我们现在的操作，都使用SqlSessionTemplate
    private SqlSessionTemplate sqlSession;

    public void setSqlSession(SqlSessionTemplate sqlSession) {
        this.sqlSession = sqlSession;
    }

    @Override
    public List<User2> selectUsers() {
        UserMapper mapper = sqlSession.getMapper(UserMapper.class);
        List<User2> users = mapper.selectUsers();
        return users;
    }
}
